import {defineStore, storeToRefs} from 'pinia'

export const useStudioStore = defineStore('studioInfo', {
    state: () => (<any>{
        identity:'',// 0陪宠师   1店长  2-普通用户（没有工作室）
        studio: {},
        studioBalance: {},
		applyStudioRecord:{},
		workSpace:null,
		applicationRecord:false,//是否存在陪宠师申请记录，存在首页的tab就显示工作室按钮
    }),
    persist: {
        storage: {
            getItem: (key : string) => uni.getStorageSync(key),
            setItem: (key : string, value : string) => uni.setStorageSync(key, value)
        }
    }
})

export const useStudioStoreToRefs = () => {
    return storeToRefs(useStudioStore())
}
export const studioReset = () => {
	useStudioStore().$reset()
}